<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html>
<head>
		<META http-equiv=Content-Type content="text/html; charset=utf-8">
		<LINK href="../styles/sciencee.css"  type=text/css rel=stylesheet>
		<style type="text/css"></style>
		<title>CGProject</title>
		<html:base/>
</head>
<body>

	<table border="0" width="100%" cellspacing="1" id="table1" style="border: 1px solid #C0C0C0">
	<html:form action="/addRole">
		<tr>
			<td height="25" align="left" bgcolor="#EEF2F7" colspan="2" width="100%">
			<b>&nbsp;<bean:message key="role.add"/></b></td>
		</tr>
		<tr>
			<td height="25" align="left" width="10%" style="border-right: 1px dotted #C0C0C0; border-bottom: 1px dotted #C0C0C0">&nbsp;<bean:message key="role.name"/></td>
			<td height="25" align="left" width="91%" style="border-bottom: 1px dotted #C0C0C0">&nbsp;<html:text property="roleName" size="20" style="border:1px solid #C0C0C0; font-family: Tahoma; font-size: 11px" />
			*</td>
		</tr>
		<tr>
			<td height="25" align="left" width="10%" style="border-left-width: 1px; border-right-style: dotted; border-right-width: 1px; border-top-width: 1px; border-bottom: 1px dotted #C0C0C0">
			&nbsp;<bean:message key="role.description"/></td>
			<td height="25" align="left" width="91%" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom: 1px dotted #C0C0C0">
			&nbsp;<html:textarea rows="7" property="illumination" cols="50" style="font-family: Tahoma; font-size: 11px"/></td>
		</tr>
		<tr>
			<td height="25" align="left" width="10%" style="border-left-width: 1px; border-right-style: dotted; border-right-width: 1px; border-top-width: 1px; border-bottom: 1px dotted #C0C0C0">&nbsp; <bean:message key="role.jurisdiction"/> </td>
			<td height="25" align="left" width="91%" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom: 1px dotted #C0C0C0">
			　</td>
		</tr>
		<logic:iterate id="element" name="Authorities">	
		<tr>
			<td height="25" align="left" width="10%" style="border-left-width: 1px; border-right-style: dotted; border-right-width: 1px; border-top-width: 1px; border-bottom: 1px dotted #C0C0C0">
			&nbsp;&nbsp;<html:multibox property="authorities"><bean:write name="element" property="authorityId"/></html:multibox></td>
			<td height="25" align="left" width="91%" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom: 1px dotted #C0C0C0">
				<bean:write name="element" property="authorityName"/>
				
				<!-- set ManageRole  -->
				<logic:equal name="element" property="authorityId" value="19">
					<html:multibox property="manages"><bean:write name="element" property="authorityId"/></html:multibox>
					<font color="#FF6666"><bean:message key="role.ismanager"/></font>
				</logic:equal>
				<logic:equal name="element" property="authorityId" value="20">
					<html:multibox property="manages"><bean:write name="element" property="authorityId"/></html:multibox>
					<font color="#FF6666"><bean:message key="role.ismanager"/></font>
				</logic:equal>
			</td>	
		</tr>
		</logic:iterate>
		<tr>
			<td height="25" align="left" width="10%" style="border-left-width: 1px; border-right-style: dotted; border-right-width: 1px; border-top-width: 1px; border-bottom: 1px dotted #C0C0C0">
			&nbsp;&nbsp;<html:checkbox property="canViewPrj" value="1"/></td>
			<td height="25" align="left" width="91%" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom: 1px dotted #C0C0C0">&nbsp;<font color="#990000"><bean:message key="role.viewallprojects"/></font> 
			　</td>
		</tr>

		<tr>
			<td height="25" align="left" width="98%" colspan="2">
			&nbsp;<input type="button" value="Submit" name="B1" style="font-family: Tahoma; font-size: 11px" onclick="submitAddRole()()">

			</td>
		</tr>
	</html:form>
	</table>
<script language="javaScript">

	function isEmpty(theField)
	{
		if(theField.value=="")
			return true;
		else
		return false;
	}
	function submitAddRole()
	{
		var emptyField=0;
	 	if(isEmpty(window.document.addRoleForm.roleName)==true)
 		{
     		alert("Please input the name！");
     		window.document.addRoleForm.roleName.focus();
     		return false;
 		}
     	window.document.addRoleForm.submit();
	 }
</script>
</body>
</html:html>
	